Conventionally, an ultrasonic sensor that detects an obstacle using an ultrasonic wave has been known (for example, see PTL 1). An ultrasonic sensor described in PTL 1 includes a piezoelectric vibrator (a transmitting unit and a receiving unit), a plurality of switches, a drive circuit, an output signal processing circuit, and a microcomputer. The piezoelectric vibrator transmits the ultrasonic wave according to a drive signal output from the drive circuit, and receives a reflected wave from the obstacle. The output signal processing circuit senses a reverberation time based on a received signal acquired by the piezoelectric vibrator, and outputs a control signal according to a sensing result. The microcomputer on-off drives the plurality of switches based on the control signal from the output signal processing circuit, and adjusts the reverberation time.